/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package helper;

import delegate.GestionDelegate;
import java.sql.SQLException;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;

/**
 *
 * @author Vanessa
 */
public class Utiles_Reporte {

    public Utiles_Reporte() {
    }

     public static void generarReporte( String reporte, Map parametros ) throws SQLException, JRException{
        JasperViewer jv = null;

        JasperPrint jp = null;
        try {
            jp = GestionDelegate.getInstance().generarReporte( reporte , parametros);
            jv = new JasperViewer(jp, false);
            jv.setExtendedState(javax.swing.JFrame.MAXIMIZED_BOTH);
            jv.setVisible(true);
        } catch (SQLException ex) {
            System.err.println( "Error al generar el reporte1: " + ex.getMessage() );
        } catch (JRException ex) {
            //Logger.getLogger(JP_ListarAcciones_Area.class.getName()).log(Level.SEVERE, null, ex);
            System.err.println( "Error al generar el reporte2: " + ex.getMessage() );
        }
    }
}
